<template>
  <div>
    <el-dialog v-bind="$attrs" v-on="$listeners" @open="onOpen" @close="onClose" title="新增文章">
      <el-form ref="dataForm" :model="formData" :rules="rules" size="medium" label-width="120px"
        label-position="left">
        <el-form-item label="文章标题" prop="articlTitle">
          <el-input v-model="formData.articlTitle" placeholder="请输入单行文本文章标题" clearable
            :style="{width: '100%'}"></el-input>
        </el-form-item>
        <el-form-item label="视频地址" prop="VideoAddress">
          <el-input v-model="formData.VideoAddress" placeholder="请输入视频地址" clearable :style="{width: '100%'}">
          </el-input>
        </el-form-item>
      </el-form>
      <div slot="footer">
        <el-button @click="close">取消</el-button>
        <el-button type="primary" @click="handelConfirm">确定</el-button>
      </div>
    </el-dialog>
  </div>
</template>
<script>
export default {
  inheritAttrs: false,
  components: {},
  props: [],
  data () {
    return {
      formData: {
        articlTitle: undefined,
        VideoAddress: undefined
      },
      rules: {
        articlTitle: [{
          required: true,
          message: '请输入单行文本文章标题',
          trigger: 'blur'
        }],
        VideoAddress: []
      }
    }
  },
  computed: {},
  watch: {},
  created () {},
  mounted () {},
  methods: {
    onOpen () {},
    onClose () {
      this.$refs.dataForm.resetFields()
    },
    close () {
      this.$emit('update:visible', false)
    },
    handelConfirm () {
      this.$refs.dataForm.validate(valid => {
        if (!valid) return
        this.close()
      })
    }
  }
}

</script>
<style>
</style>
